from typing import Optional
from datetime import datetime
from pydantic import BaseModel

class AttractionTicketBase(BaseModel):
    work_area_id: int = -1
    package_order_id: int = -1
    package_order_title: Optional[str] = None
    attraction_name: str
    visit_date: datetime
    number_of_tickets: int
    price_per_ticket: float
    booking_fee: float = 0
    total_amount: float
    currency: str = "HKD"
    ticket_type: str
    ticket_status: Optional[str] = None
    notes: Optional[str] = None

class AttractionTicketCreate(AttractionTicketBase):
    pass

class AttractionTicketUpdate(BaseModel):
    package_order_id: Optional[int] = None
    package_order_title: Optional[str] = None
    attraction_name: Optional[str] = None
    visit_date: Optional[datetime] = None
    number_of_tickets: Optional[int] = None
    price_per_ticket: Optional[float] = None
    booking_fee: Optional[float] = None
    total_amount: Optional[float] = None
    currency: Optional[str] = None
    ticket_type: Optional[str] = None
    ticket_status: Optional[str] = None
    notes: Optional[str] = None

class AttractionTicket(AttractionTicketBase):
    ID: int

    class Config:
        from_attributes = True 